package by.brest.bspc.service.repository;

import by.brest.bspc.domain.Student;
import by.brest.bspc.repository.StudentRepository;
import by.brest.bspc.service.StudentRepositoryService;
import org.springframework.beans.factory.annotation.Required;

import javax.annotation.Resource;
import java.util.List;

/**
 * Implements service for repository.
 *
 * @date: 10/5/13 6:24 PM
 * @author: frehty
 */
public class StudentRepositoryServiceImpl implements StudentRepositoryService {

    private StudentRepository studentRepository;

    @Resource
    @Required
    public void setStudentRepository(StudentRepository studentRepository) {
        this.studentRepository = studentRepository;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void saveStudent(Student student) {
        studentRepository.saveStudent(student);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public int getCurrentClassByGroupName(String groupName) {
        return studentRepository.getCurrentClassByGroupName(groupName);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public List<Student> getStudentsList(String groupName, int semesterNumber) {
        return studentRepository.getStudentsList(groupName, semesterNumber);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public List<String> updateGraduatedStudents() {
        return studentRepository.updateGraduatedStudents();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void updateStudentsList(List<Student> studentsList) {
        studentRepository.updateStudentsList(studentsList);
    }


}
